package com.ecs.server.datadealer;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class ClientManager {
	
	private static ServerSocket ss;
	public static SessionFactory factory;
	
	public ClientManager() throws Exception
	{
		ss = new ServerSocket(1986);
		Configuration cfg = new Configuration().configure();
		factory = cfg.buildSessionFactory();
		System.out.println("ECS SYSTEM HAS ALEADY STARTED!");
		while(true)
		{
			Socket s = ss.accept();
			Thread th = new Thread(new SingleClient(s));
			th.start();
		}
	}
	
	public static void main(String[] args) throws Exception {
		new ClientManager();
	}
	
}

